package com.atstudy.map;

import java.util.HashMap;

/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2023/1/3 16:20
 * @copyright: 博为峰
 */
public class HashMapDemo {
    public static void main(String[] args) {
        HashMap<String, String> hashMap = new HashMap<String, String>();
        m1(hashMap);
//        m2(hashMap);
//        m3(hashMap);
//        System.out.println(hashMap);
    }

    private static void m3(HashMap<String, String> hashMap) {
        System.out.println(hashMap.get("李四"));
        System.out.println(hashMap.size());
    }

    private static void m2(HashMap<String, String> hashMap) {
        hashMap.remove("张三");
        hashMap.clear();
    }

    private static void m1(HashMap<String, String> hashMap) {
        hashMap.put("张三", "男");//增
        hashMap.put("李四", "女");//增
        hashMap.put("李四", "男");//改
    }
}
